<?php
namespace Amis\dataviewer;

use Amis\Basics\AmisBasics;

class Sparkline extends AmisBasics
{
    public string $type = 'sparkline';

    /**
     * 关联的变量
     * @param string $name
     * @return $this
     */
    public function name(string $name)
    {
        $this->name = $name;
        return $this;
    }

    /**
     * 宽度
     * @param int $width
     * @return $this
     */
    public function width(int $width)
    {
        $this->width = $width;
        return $this;
    }

    /**
     * 高度
     * @param int $height
     * @return $this
     */
    public function height(int $height)
    {
        $this->height = $height;
        return $this;
    }

    /**
     * 数据为空时显示的内容
     * @param string $placeholder
     * @return $this
     */
    public function placeholder(string $placeholder)
    {
        $this->placeholder = $placeholder;
        return $this;
    }
}